<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>提交事件</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<link href="<?php echo base_url()?>media/css/style.css" type="text/css" rel="stylesheet"/>
<script type="text/javascript" src="<?php echo base_url()?>media/js/jquery/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="<?php echo base_url()?>media/js/jquery/jquery.validate.min.js"></script>
<script type="text/javascript" src="<?php echo base_url()?>media/js/swfupload/swfupload.js"></script>
<script type="text/javascript" src="<?php echo base_url()?>media/js/swfupload/swfupload.queue.js"></script>
<script type="text/javascript" src="<?php echo base_url()?>media/js/swfupload/fileprogress.js"></script>
<script type="text/javascript" src="<?php echo base_url()?>media/js/swfupload/handlers.js"></script>
<script type="text/javascript" src="<?php echo base_url()?>media/js/check/CheckAgentForm.js"></script>
</head>
<body>
<div class="form_div" >
	<h5>新建事件/服务请求</h5>
	<form action="<?=base_url()?>innerUser/AddEventByAgent/?eventId=<?=$eventId?>" method="post" id="NewRequestByAgent">
		<div class="form_block black_border margin_t_b_5">
			<div class="input_item input_item_width140 margin_r_160">
				<label>用户名</label>
				<input type="text" style="width:140px;" readonly="true" name="event_owner" value="<?php if ($owner_info) {echo $owner_info['realname'];}?>" />
			</div>
			<div class="select_item">
				<label>用户类型</label>
				<select name="event_usertype" readonly="true">
					<?php foreach($event_usertype_list as $row):?>
                    <option value="<?php echo $row['option_id'];?>"><?php echo $row['option_name'];?></option>
                    <?php endforeach;?>
				</select>
			</div>
			<div class="input_item input_item_width140 margin_r_160">
				<label>公司部门</label>
				<input type="text" name="department" value="<?php if ($owner_info) {echo $owner_info['department'];}?>" readonly="true"/>
			</div>
			<div class="input_item" style="width:250px">
				<label>联系电话</label>
				<input type="text" name="phone1" readonly="true" style="width:30px;"/>
				<input type="text" name="phone2" readonly="true"/> -
				<input type="text" name="phone3" style="width:30px;" readonly="true"/>
			</div>
			<div class="input_item input_item_width140 margin_r_160" >
				<label>邮件地址</label>
				<input type="text" name="email" readonly='true' value="<?php if ($owner_info) {echo $owner_info['email'];}?>" />
			</div>
			<div class="input_item input_item_width140">
				<label>手机</label>
				<input type="text" name="mobile" readonly="true"/>
			</div>
			<div class="input_item input_item_width500">
				<label>地址</label>
				<input type="text" name="address" readonly="true" />
			</div>
		<div class="clear_both"></div>
		</div>
		<div class="form_block black_border margin_t_b_5">
			<div class="input_item">
				<label>事件号</label>
				<input type="text" style="width:120px;" name="event_id" value="SJ<?php printf("%08d", $eventId);?>" readonly/>
			</div>
			<div class="select_item">
				<label>请求类型</label>
				<select name="event_type">
					<?php foreach($event_type_list as $row):?>
                    <option value="<?php echo $row['option_id'];?>"><?php echo $row['option_name'];?></option>
                    <?php endforeach;?>
				</select>
			</div>
			<div class="select_item">
				<label>紧急程度</label>
				<select name="event_emergency">
					<?php foreach($event_emergency_list  as $code=>$name):?>
                    <option value="<?php echo $code;?>"><?php echo $name;?></option>
                    <?php endforeach;?>
				</select>
			</div>
			<div class="input_item">
				<label>影响开始时间</label>
				<input type="text" name="event_begintime" value="<?=date('Y-m-d H:i:s')?>" style="width:120px" />
			</div>
			<div class="select_item">
				<label>影响范围</label>
				<select name="event_influencearea">
					<?php foreach($event_influencearea_list as $row):?>
                    <option value="<?php echo $row['option_id'];?>"><?php echo $row['option_name'];?></option>
                    <?php endforeach;?>
				</select>
			</div>
			<div class="select_item">
				<label>来源</label>
				<select name="event_source">
					<?php foreach($event_source_list as $row):?>
                    <option value="<?php echo $row['option_id'];?>"><?php echo $row['option_name'];?></option>
                    <?php endforeach;?>
				</select>
			</div>
					<div class="select_item margin_r_218">
						<label>类别</label>
						<select name="event_category">
							<?php foreach($event_cat_list as $row):?>
                            <option value="<?php echo $row['option_id'];?>"><?php echo $row['option_name'];?></option>
                            <?php endforeach;?>
						</select>
					</div>
					<div class="select_item">
						<label>子类</label>
						<select name="event_subclass">
							<?php foreach($event_subclass as $row): ?>
                            <option value="<?=$row['option_id']?>"><?=$row['option_name']?></option>
                            <?php endforeach; ?>
						</select>
					</div>
			<div class="input_item input_item_width500" >
				<label>主题</label>
				<input type="text" name="event_title" /><span class="redfont">(*)</span>
			</div>
			<div class="textarea_item" >
				<label>描述</label>
				<textarea name="event_desc"></textarea><span class="redfont">(*)</span>
			</div>
				<div id="uploaded_file_info"  class="uploaded_file_info" style="padding-left:80px;clear:both;">
				<div id="fsUploadProgress"></div>
				</div>
				<div class="clear_both"></div>
			<div class="upload_item">
				<label>附件</label>
				<span id="upload_btn"></span><input id="btnCancel" type="button" value="cancel" style="display:none;" />
			</div>
			<div class="clear_both"></div>
			<div class="clear_both"></div>
			<div class="input_item input_item_width300">
				<label>影响业务</label>
				<input type="text"  name="event_influencebusiness" />
			</div>
			<div class="clear_both"></div>
		</div>
		<div class="clear_both"></div>
		<div class="form_block black_border margin_t_b_5" style="text-align:center">
			<input type="submit" style="margin-right:30px" class="sub_btn" value="提交" />
			<input type="reset" class="btn_60_24" value="重置" />
		</div>
	</form>
</div>
</body>
</html>
<script>
var swfu;
var settings = {
				flash_url : "<?=base_url()?>media/flash/swfupload.swf",
				upload_url: "<?=base_url()?>upload/uploadAttachment/eventId/<?php echo $eventId;?>",
				post_params: {"PHPSESSID" : "<?php echo session_id(); ?>"},
				custom_settings : {
					progressTarget : "fsUploadProgress",
					cancelButtonId : "btnCancel",
					base_url:"<?=base_url()?>",
					uploadedFileInfoDiv:"uploaded_file_info"
				},
				debug: false,
				// Button settings
				button_image_url: "<?=base_url()?>media/images/upload_btn.gif"
			};
			swfu = new SWFUpload($.extend(settings,defaultSetting));
			$(".del_attach").live('click',function(){
				var divObj = $(this);
				$.get('<?php echo base_url()?>upload/delAttachment/aid/'+divObj.attr('aid'),function(data){
					if(data=='success')
					{
						divObj.parent().fadeOut();
					}
				});
			})
</script>
